package edu.cuit.avatar.mapper;

import edu.cuit.avatar.dto.DepartmentDto;
import edu.cuit.avatar.pojo.Department;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/29 9:58
 */
public interface DepartmentMapper {
    void insert(Department dept);

    Department findById(Integer id);

    List<Department> limit(DepartmentDto params);

    /**
     * 按条件进行分页查询
     * 1. 如果部门id不为空，则按照部门id进行查找
     * 2. 否则如果部门名称不为空,则部门名称进行模糊查询
     * 3. 如果上述条件都不满足,则按照部门创建日期不为空进行查询
     * @param dept
     * @return
     */
    List<Department> query(Department dept);

    int batchDelete(@Param("ids") Integer ... ids);
}
